import service from '../utils/request'

export function fetchDepartmentListByName (params) {
  return service({
    url: '/dept/get',
    method: 'get',
    params
  })
}
// 查询小组
export function fetchGroupList (data) {
  return service({
    url: '/group/select',
    method: 'post',
    data
  })
}

// 查询班级
export function getClass (data) {
  return service({
    url: '/class/select',
    method: 'post',
    data
  })
}

// 查询老师
export function getTeacher (data) {
  return service({
    url: '/teacher/select',
    method: 'post',
    data
  })
}

// 查询学生
export function getStudents (data) {
  return service({
    url: '/student/select',
    method: 'post',
    data
  })
}

// 添加小组
export function addGroup (data) {
  return service({
    url: '/group',
    method: 'post',
    data
  })
}

// 根据班级添加小组
export function addClassGroup (data) {
  return service({
    url: '/group/class',
    method: 'post',
    data
  })
}
// 删除小组
export function deleteGroup (params) {
  return service({
    url: `/group/${params}`,
    method: 'delete'
  })
}
// 修改小组
export function editGroup (data) {
  return service({
    url: '/group',
    method: 'put',
    data
  })
}
